import Vue from "vue";
import Vuex from "vuex";
// 引入持久化插件
import persistence from "vuex-uniapp-persistence"
// 引入其它模块
import user from "./user";
import address from "./address";
Vue.use(Vuex);
const store = new Vuex.Store({
  state: {
  //  安全区域
  safeArea:uni.getWindowInfo().safeArea,
  // 胶囊
  capsule:uni.getMenuButtonBoundingClientRect(),
  // 获取当前用户客户端平台类型 ios 或者android
  platform: uni.getSystemInfoSync().platform,
  },
  getters: {},
  mutations: {
    
  },
  modules: {
    user,
    address,
   },
  // 2.使用持久化插件
  plugins:[persistence()]
});
export default store;
